from decimal import Decimal
from typing import *
from utils.error import BaseError


class BaseExchange:
    def __init__(self):
        pass

    def swap_position(self) -> List[Dict[str, Any]]:
        pass

    def swap_balance(self) -> Dict[str, Decimal]:
        pass

    def spot_balance(self) -> Dict[str, Decimal]:
        pass

    def spot_trade(self, trades: Union[List[Dict[str, Any]], Dict[str, Any]]) -> List[Tuple[bool, Any]]:
        pass

    def swap_trade(self, trades: Union[List[Dict[str, Any]], Dict[str, Any]]) -> List[Tuple[bool, Any]]:
        pass

    def transfer(self, orders: List[Dict[str, Any]]) -> List[bool]:
        pass

    def swap_leverage(self, leverage: List[int], symbol: List[str]) -> Dict[str, bool]:
        pass

    def margin_type(self, symbol: List[str], update: str = 'ISOLATED') -> None:
        pass

    def swap_position_side(self, update_to: bool = None) -> Optional[bool]:
        pass

    @property
    def spot_exchange_info(self) -> Dict[str, Any]:
        raise BaseError(f'基类调用')

    @property
    def swap_exchange_info(self) -> Dict[str, Any]:
        raise BaseError(f'基类调用')

    @property
    def spot_symbol_prices(self) -> Dict[str, Decimal]:
        raise BaseError(f'基类调用')

    @property
    def swap_symbol_prices(self) -> Dict[str, Decimal]:
        raise BaseError(f'基类调用')

    def account_balance(self) -> Decimal:
        pass

    def convert_asset(self, asset: List[str]):
        """
        将币种转换为BNB
        :param asset:
        :return:
        """
        pass
